package com.biaobiaoqi.scoreanalysis.administrator.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.hibernate.bean.Teacher;
import com.biaobiaoqi.scoreanalysis.service.ITeacherService;
import com.opensymphony.xwork2.ActionSupport;

public class ListTeacher extends ActionSupport {
	private static final Log log = LogFactory.getLog(ListTeacher.class);
 	private static final long serialVersionUID = -3115801791L;
 	private List<Teacher> list;
 	private int currentPage=0;
 	@Resource
 	private ITeacherService teacherService;
 	
 	public String execute() {
 		log.debug("listTeacher page:"+currentPage);
 		try {
 	 		list = teacherService.listAllTeacher(currentPage*9, 9);
 	 		return SUCCESS;	
		} catch (Exception e) {
			log.error("list teacher failed.", e);
			addActionError("读取教师列表失败");
			return ERROR;
		}
 	}
  	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public List<Teacher> getList() {
		return list;
	}
	public void setList(List<Teacher> list) {
		this.list = list;
	}

}
